﻿using System.Linq;
using CI.Models.Data;
using CI.Models.Production;
using CI.Models.Production.Interfaces;
using CI.ViewModels.Diagramming;

namespace CI.ViewModels
{
    public class GroupItemSelectorViewModel : InventoryItemSelectorViewModelBase
    {
        public GroupItemSelectorViewModel(IStaticDataRepository<Item> itemDataRepository, string groupName,
                                          DiagramViewModel parentViewModel, params int[] groupIDs)
            : base(groupName, parentViewModel)
        {
            var o = groupIDs.ToList();

            PreFiltered = itemDataRepository.All.Where(i => o.Contains(i.GroupID)).AsQueryable();

            ApplyFilter();
        }
    }
}